package com.water.app.Impl.shopping;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import java.util.concurrent.BlockingDeque;
import java.util.concurrent.LinkedBlockingDeque;

@Configuration
public class QueueConfig {
    // 注册阻塞队列为 Spring 单例 Bean，供 Consumer 注入
    @Bean
    public BlockingDeque<ShoppingServiceImpl.GoodsIdListAndUserId> taskQueue() {
        return new LinkedBlockingDeque<>(1000); // 容量1000，和之前保持一致
    }
}